<template>
  <a-config-provider :locale="locale">
    <template #renderEmpty>
      <hv-custom-empty />
    </template>
    <router-view />
    <hv-spinning />
  </a-config-provider>
</template>

<script setup lang="ts">
  import { extendFonticonUrls } from './shared/configs/extend-icon';
  import registerHttpInterceptor from '@/shared/interceptors/http-interceptor';
  import { useRouter } from 'vue-router';
  import dayjs from 'dayjs';
  import 'dayjs/locale/zh-cn';
  import zhCN from 'ant-design-vue/es/locale/zh_CN';
  import { useVisualConfigStore } from '@/visual/stores/visual-config';

  dayjs.locale('zhCN');
  const locale = zhCN;

  const useVisualConfig = useVisualConfigStore();
  //配置扩展图标
  useVisualConfig.setExtendFontIconUrls(extendFonticonUrls);

  //配置用户信息
  useVisualConfig.setUserInfo({
    userId: 'hippoVisualAdminUserId',
    userName: '管理员',
  });

  //配置路由地址
  useVisualConfig.setRoutePath({
    dashboardRoot: '/dashboard',
    visualRoot:'/visual'
  });

  registerHttpInterceptor(useRouter());
</script>

<style lang="less" scoped></style>
